import datetime

from apps.tender_project.tender_project.clean.project_clean import ProjectClean
from apps.tender_project.tender_project.clean.tender_clean import TenderClean


def run():
    project = ProjectClean(
        origin_table="net_project_info", target_table="net_project_info_new",
        redis_task_keys="net_project_info:wash:task"
    )
    project.time_wash(
        (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
        datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    )
    tender = TenderClean(
        origin_table="net_tender_info", target_table="net_tender_info_new", redis_task_keys="net_tender_info:wash:task"
    )
    tender.time_wash(
        (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),
        datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    )


if __name__ == '__main__':
    run()
